<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue生命周期</title>
</head>
<body>

<div id="app">
    <div><h1>{{message}}</h1></div>

</div>

<script src="../js/vue.js"></script>
<script>
    var vue=new Vue({
        el:"#app",
        data:{
            message:"happy new year",
        },
        methods:{
            show(msg,obj) {
                console.log(msg);
                console.log("data:"+obj.message);
                console.log("获取元素:"+document.getElementById("app").innerHTML);
            }
        },
        //数据渲染前
        created (){
            this.message="新年快乐";
            this.show("接收到msg-created",this);
        },
        //数据渲染后
        mounted (){
            this.message="hhhh";
            this.show("接收到msg--mounted",this);
        }
    })

</script>
</body>
</html>